package com.gec.service.impl;

import com.gec.bean.UserFundProduct;
import com.gec.bean.UserFundProductExample;
import com.gec.mapper.UserFundProductMapper;
import com.gec.service.UserFundProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//业务层的实现类
//标识为业务层的代码
@Service
public class UserFundProductServiceImpl implements UserFundProductService {

    //IOC获取userMapper的对象
    @Autowired
    UserFundProductMapper userFundProductMapper;
    @Override
    public boolean insertUserFundProduct(UserFundProduct userFundProduct){
        return userFundProductMapper.insertSelective(userFundProduct)>0?true:false;
    }
    @Override
    public List<UserFundProduct>queryUserFundProduct(){
        return userFundProductMapper.selectByExample(new UserFundProductExample());
    }
    @Override
    public UserFundProduct queryId(int id){
        return userFundProductMapper.selectByPrimaryKey(id);
    }
    @Override
    public boolean updateUserFundProduct(UserFundProduct userFundProduct) {
        return userFundProductMapper.updateByPrimaryKeySelective(userFundProduct)>0?true:false;
    }
    @Override
    public boolean deleteUserFundProduct(int id){
        return userFundProductMapper.deleteByPrimaryKey(id)>0?true:false;
    }

}
